package com.lv.phuotbacnam.ui.widget.wizard;

/**
 * Wizard support
 */
public abstract class Wizard<T> {

    private OnNavigationChangedListener onNavigationChangedListener;

    /**
     * Go to next page
     */
    public abstract void next();

    /**
     * Go to previous page
     */
    public abstract void previous();

    /**
     * Return the current page
     * @return
     */
    public abstract int getCurrentPage();

    /**
     * Jump to a certain page
     * @param page Page to jump to
     */
    public abstract void jumpTo(int page);

    /**
     * Get the items count
     * @return Items count
     */
    public abstract int getItemsCount();

    /**
     * Get collected data
     * @return Collected information
     */
    public abstract T getData();

    public OnNavigationChangedListener getOnNavigationChangedListener() {
        return onNavigationChangedListener;
    }

    public void setOnNavigationChangedListener(OnNavigationChangedListener onNavigationChangedListener) {
        this.onNavigationChangedListener = onNavigationChangedListener;
    }

    /**
     * Callback interface for wizard navigation
     */
    public static interface OnNavigationChangedListener{

        void onLowerBoundTouched();

        void onPageSelected(int page);

        void onUpperBoundTouched();
    }
}
